package com.yonyou.cloud.member.domainmodel.entities.member;

import com.yonyou.cloud.member.domainmodel.vo.MemberId;
import com.yonyou.cloud.member.libs.util.DateTimeUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDateTime;

@ApiModel(description = "会员档案")
public class Member {
    @ApiModelProperty(value = "会员ID", dataType = "java.lang.Long")
    private MemberId id;
    @ApiModelProperty(value = "会员名称")
    private String name;
    @ApiModelProperty(value = "手机号码")
    private String phone;
    @ApiModelProperty(value = "会员级别")
    private String level;
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    public Member() {
    }

    public Member(MemberId id, String name, String phone) {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.createTime = DateTimeUtils.fromTimestamp(id.ts());
    }

    public MemberId getId() {
        return id;
    }

    public void setId(MemberId id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getLevel() {
        return level;
    }

    public Member setLevel(String level) {
        this.level = level;
        return this;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
}
